#pragma once
#ifndef __MATRIX_4X4_H__
#define __MATRIX_4X4_H__

#include <d3dx9math.h>
#include "vector4.h"

class c_matrix4x4 : public D3DXMATRIX
{
public:
    inline c_matrix4x4() {}
	inline c_matrix4x4(const c_matrix4x4&); 
    inline explicit c_matrix4x4(const D3DXMATRIX&); 
    inline explicit c_matrix4x4(const float*); 
    inline c_matrix4x4( 
        float _11, float _12, float _13, float _14,
        float _21, float _22, float _23, float _24,
        float _31, float _32, float _33, float _34,
        float _41, float _42, float _43, float _44 );

    inline static c_matrix4x4 Identity(); 

    inline void inverse(); 
    inline void transpose(); 

    inline c_matrix4x4& operator = (const D3DXMATRIX&); 
    inline c_matrix4x4  operator * (const c_matrix4x4&) const;
    
private:
    static c_matrix4x4 m_identity;
};

c_matrix4x4 make_view_matrix(const c_vector3& eye_pos, const c_vector3& lookat, const c_vector3& up);
c_matrix4x4 make_perspective_proj_matrix(const float fov, const float aspect, const float near_plane, const float far_plane); 

#include "matrix4x4.inl"

#endif